/*
Copyright (C) 2015 Marien Raat

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <SFML/Graphics.hpp>
#include <random>
#include <enemy.h>
#include <player.h>

#if defined(_WIN32) || defined(WIN32) || defined(__WIN32__)
#define OS_WIN
#endif

#define PI 3.1415926535897932384

class EnemyManager {
public:
    EnemyManager(sf::Vector2u screenSize);
    bool update(Player *player);
    void draw(sf::RenderWindow *window);
    Enemy *enemies;
private:
    static const int ammountOfEnemies = 30;
    sf::Vector2u screenSize;

    sf::Texture *textures;

#ifndef OS_WIN
    std::random_device *randomDevice;
#endif
    std::mt19937 *mt;
    std::uniform_int_distribution<int> upOrDown,
        xValueDist, yValueDist;
    std::uniform_real_distribution<double> *rotationD;
    std::uniform_real_distribution<double> *radius;

    void createNewEnemyAt(int index);
};
